react convert string to slug

129

react convert string to slug -

function convertToSlug(Text)
{
    return Text
        .toLowerCase()
        .replace(/ /g,'-')
        .replace(/[^\w-]+/g,'')
        ;
}

Comments

Submit
0 Comments